<template>
    <div id="modal">
       <keep-alive include="login">
           <component :is="$store.state.loginName"></component>
       </keep-alive>
    </div>
</template>
<script>
import login from "./components/login.vue"
export default {
    data() {
        return {
           show:true 
        }
    },
    methods: {
    },
    components:{
        login,
        registered:()=>import("./components/registered.vue"),
        user:()=>import("./components/user.vue")
    },
    mounted(){
        if(window.localStorage.getItem("isLogin")!=undefined){
            this.$store.commit('changeLoginName',"user")
        }
    }
}
</script>
<style scoped lang="scss">
    #modal{
        height: 1000px;
        background-color: rgba(128, 128, 128,0.5);
        position: fixed;
        top: 120px;
        width: 100%;
    }
</style>